package com.tuozixuan.forest.condition;

import com.dtflys.forest.callback.SuccessWhen;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;

public class SuccessCondition implements SuccessWhen {

	@Override
	public boolean successWhen(ForestRequest req, ForestResponse res) {
		return res.noException() &&   // 请求过程没有异常
                res.statusOk() &&     // 并且状态码在 100 ~ 399 范围内
                res.statusIsNot(203); 
	}

}
